package label_center

const (
	CHAR_IMAGE_SPLIT = "_"     //图片命名分隔符
	PREFIX_IMAGE     = "IMAGE" //图片命名前缀
	PREFIX_VIdEO     = "VIdEO" //视频命名前缀

	LAYOUT_DATE_TIME = "2006-01-02 15:04:05" // 日期时间格式布局
	LAYOUT_DATE      = "2006-01-02 00:00:00" // 日期格式布局
	LAYOUT_TIME      = "2000-01-01 15:04:05" // 时间格式布局
	DATE_TIME_END    = "2099-01-01 00:00:00" // 默认结束时间

)

// 媒体路由 OpenApi可忽略
// https://devgit.zhcit.com:13000/zhc/MediaRouter/src/branch/develop/rpcx/http_server/rpcxServer.go
const (
	SERVICE_PATH_媒体路由 = "MediaRouter"

	MEDIA_ROUTER_SERVICE_NAME_链路检查 = "Ping"

	MEDIA_ROUTER_SERVICE_NAME_实时调阅 = "PullStream"        //GetStream
	MEDIA_ROUTER_SERVICE_NAME_历史调阅 = "HistoryPullStream" // HistoryDraggingRatioPlay

	MEDIA_ROUTER_SERVICE_NAME_注册阳光业扩流 = "PullStream"

	MEDIA_ROUTER_SERVICE_NAME_下载历史视频   = "DownloadHistoryVideo"
	MEDIA_ROUTER_SERVICE_NAME_历史视频拖动   = "HistoryOffsetPlay"
	MEDIA_ROUTER_SERVICE_NAME_历史视频倍速播放 = "HistoryScalePlay"

	MEDIA_ROUTER_SERVICE_NAME_视频合流调阅         = "MergeStream"
	MEDIA_ROUTER_SERVICE_NAME_视频停止合流         = "stopMergeStream"
	MEDIA_ROUTER_SERVICE_NAME_查询合并视频流命令的运行状态 = "getMergeStreamStatus"
	MEDIA_ROUTER_SERVICE_NAME_结构化调阅          = "StructStream"

	MEDIA_ROUTER_SERVICE_NAME_设备管理中心添加新媒体流并记录分配的推流端口 = "AddStream"
	MEDIA_ROUTER_SERVICE_NAME_设备管理中心删除媒体流            = "DelStream"
	MEDIA_ROUTER_SERVICE_NAME_视频流状态列表观看人数使用情况        = "StreamStatusList"

	MEDIA_ROUTER_SERVICE_NAME_注册移动电话设备 = "RegisterMobilePhoneVideoDevice"
	MEDIA_ROUTER_SERVICE_NAME_登陆移动电话设备 = "LoginMobilePhoneVideoDevice"

	MEDIA_ROUTER_SERVICE_NAME_运维平台获取媒体中心列表      = "GetMediaCenterList"
	MEDIA_ROUTER_SERVICE_NAME_运维平台添加部署新的媒体中心及配置 = "AddrMediaCenter"
	MEDIA_ROUTER_SERVICE_NAME_运维平台更新媒体中心配置      = "UpdateMediaCenter"
	MEDIA_ROUTER_SERVICE_NAME_媒体中心通过接口获取对应配置项   = "GetMediaCenterOne"
	MEDIA_ROUTER_SERVICE_NAME_运维平台删除媒体中心配置      = "DeleteMediaCenter"

	MEDIA_ROUTER_SERVICE_NAME_媒体流列表 = "GetMediaStreamList"
	MEDIA_ROUTER_SERVICE_NAME_删除媒体流 = "DeleteMediaStream"
)

// 媒体中心 OpenApi可忽略
// https://devgit.zhcit.com:13000/zhc/MediaServer-doc/src/branch/main/%E6%8E%A5%E5%8F%A3IdL%E6%96%87%E4%BB%B6/%E5%AA%92%E4%BD%93%E4%B8%AD%E5%BF%83/server.go

const (
	SERVICE_PATH_媒体中心 = "MediaServer"

	// MEDIA_CENTER_RPCX_NAME_链路检查 = "getStartupTime"

	// MEDIA_CENTER_RPCX_NAME_历史抽图 = "AddHistorySnapshot"
	// MEDIA_CENTER_RPCX_NAME_实时抽图 = "AddRealtimeSnapshot"
	// MEDIA_CENTER_RPCX_NAME_抽图状态 = "QuerySnapshot"
	// MEDIA_CENTER_RPCX_NAME_删除抽图 = "DelSnapshot"

	// MEDIA_CENTER_RPCX_NAME_启动合流     = "StartMergeStream"
	// MEDIA_CENTER_RPCX_NAME_停止合流     = "StopMergeStream"
	// MEDIA_CENTER_RPCX_NAME_合流状态     = "GetMergeStreamStatus"
	// MEDIA_CENTER_RPCX_NAME_烟雾测试     = "SmokeTest"
	// MEDIA_CENTER_RPCX_NAME_增流代理     = "AddStreamProxy"
	// MEDIA_CENTER_RPCX_NAME_获流状态     = "GetStreamStatus"
	// MEDIA_CENTER_RPCX_NAME_启动RTP    = "OpenRtpServer"
	// MEDIA_CENTER_RPCX_NAME_启动历史RTP  = "OpenRtpServerForHistory"
	// MEDIA_CENTER_RPCX_NAME_获取M3U8地址 = "GetM3u8Url"

	MEDIA_CENTER_HTTP_PATH_获流列表 = "getStreamStatus"
	MEDIA_CENTER_HTTP_PATH_历史抽图 = "addHistorySnapshot"
	MEDIA_CENTER_HTTP_PATH_实时抽图 = "addRealtimeSnapshot"
	MEDIA_CENTER_HTTP_PATH_事件侦听 = "addEventListener"

	MEDIA_CENTER_HTTP_PATH_抽图状态 = "QuerySnapshot" //TODO ?

	MEDIA_CENTER_HTTP_PATH_删除抽图  = "DelSnapshot"
	MEDIA_CENTER_HTTP_PATH_启动合流  = "StartMergeStream"
	MEDIA_CENTER_HTTP_PATH_停止合流  = "StopMergeStream"
	MEDIA_CENTER_HTTP_PATH_合流状态  = "GetMergeStreamStatus"
	MEDIA_CENTER_HTTP_PATH_烟雾测试  = "SmokeTest"
	MEDIA_CENTER_HTTP_PATH_增流代理  = "AddStreamProxy"
	MEDIA_CENTER_HTTP_PATH_启动RTP = "OpenRtpServer"

	MEDIA_CENTER_HTTP_PATH_启动历史RTP  = "OpenRtpServerForHistory"
	MEDIA_CENTER_HTTP_PATH_获取M3U8地址 = "GetM3u8Url"
)

const (
	MEDIA_CENTER_HTTP_PATH_获图片列表 = "getImageList"
)

// 设备管理中心 OpenApi可忽略
// https://devgit.zhcit.com:13000/zhc/DeviceManager/src/branch/master/rpcx/http_server/http_device_manager_centre_server.go

const (
	SERVICE_PATH_设备管理 = "DeviceManager"

	/*视频调阅接口*/
	DEVICE_MANAGER_SERVICE_NAME_视频调阅           = "CallToVideoPushFlow"
	DEVICE_MANAGER_SERVICE_NAME_视频停止推流         = "StopPushFlowVideo"
	DEVICE_MANAGER_SERVICE_NAME_通知接入中心_关闭视频流成功 = "NotifyDccCloseStreamSuccess"
	DEVICE_MANAGER_SERVICE_NAME_获取正在推的实时流信息列表  = "PushStreamListQuery"
	DEVICE_MANAGER_SERVICE_NAME_媒体路由通知接入中心     = "PublicNotify"

	/*历史视频接口*/
	DEVICE_MANAGER_SERVICE_NAME_历史视频文件列表 = "CameraHistoryFileList"
	DEVICE_MANAGER_SERVICE_NAME_播放历史视频   = "CameraHistoryPlay"
	DEVICE_MANAGER_SERVICE_NAME_历史视频倍速播放 = "CameraHistoryScalePlay"
	DEVICE_MANAGER_SERVICE_NAME_历史拖动视频   = "CameraHistoryOffsetPlay"
	DEVICE_MANAGER_SERVICE_NAME_历史视频下载   = "DownloadHistoryVideoFile"

	/*接入中心上报接口*/
	DEVICE_MANAGER_SERVICE_NAME_接入中心上报_心跳      = "DccHeartBeatCheck"
	DEVICE_MANAGER_SERVICE_NAME_接入中心上报_设备是否存在  = "DeviceISExistQuery"
	DEVICE_MANAGER_SERVICE_NAME_接入中心上报_状态表     = "DeviceStatusListReport"
	DEVICE_MANAGER_SERVICE_NAME_接入中心上报_配置      = "SipLoadConnectCentreConfig"
	DEVICE_MANAGER_SERVICE_NAME_接入中心上报_QB      = "QB_ImmediateReportToServer"
	DEVICE_MANAGER_SERVICE_NAME_接入中心上报_历史报告    = "SipDeviceHistoryListReport"
	DEVICE_MANAGER_SERVICE_NAME_接入中心获取配置信息     = "QB_LoadAllDeviceConnectInfo"
	DEVICE_MANAGER_SERVICE_NAME_接入中心上报重启恢复数据   = "UploadConnectCenterData"
	DEVICE_MANAGER_SERVICE_NAME_接入中心获取重启恢复数据   = "DownloadConnectCenterData"
	DEVICE_MANAGER_SERVICE_NAME_QB接入中心上报重启恢复数据 = "QB_ReportPushStreamsToServer"
	DEVICE_MANAGER_SERVICE_NAME_QB接入中心获取重启恢复数据 = "QB_GetAllPushStreams"

	/*云台控制接口*/
	DEVICE_MANAGER_SERVICE_NAME_云台通用控制   = "cameraGimbalControl"
	DEVICE_MANAGER_SERVICE_NAME_云台预置点操作  = "ptzPresetControl"
	DEVICE_MANAGER_SERVICE_NAME_摄像头布防    = "cameraGuardControl"
	DEVICE_MANAGER_SERVICE_NAME_云台预置点_列表 = "ptzPresetList"

	/*数据库操作接口*/
	DEVICE_MANAGER_SERVICE_NAME_添加NVR设备_批量添加子设备 = "AddNVRDevice"
	DEVICE_MANAGER_SERVICE_NAME_添加移动视频设备        = "AddMobileDevice"
	DEVICE_MANAGER_SERVICE_NAME_接入中心配置          = "AccessConnectCenter"
	DEVICE_MANAGER_SERVICE_NAME_设备接入方案          = "ConnectSolution"
	DEVICE_MANAGER_SERVICE_NAME_设备管理            = "DeviceInfoManager"
	DEVICE_MANAGER_SERVICE_NAME_订阅关系            = "SubscribeCenter"
	DEVICE_MANAGER_SERVICE_NAME_级联关系            = "CascadeRelationCenter"
	DEVICE_MANAGER_SERVICE_NAME_获取地域Id_省标       = "ProvinceIdSymbols"
	DEVICE_MANAGER_SERVICE_NAME_获取地域Id          = "DeviceIdSymbols"

	DEVICE_MANAGER_HTTP_PATH_摄像头布防 = "CameraGuardControl"
)

// // 状态 记录
// const (
// // Status正常 = 10
// // Status删除 = -10
// )

// 响应 结构体
type Reply struct {
	Code   int         `json:"Code"`            //结果码: 正常=0 失败>0
	Status string      `json:"Status"`          //正常=OK，失败=具体错误内容
	Error  string      `json:"Error,omitempty"` //错误信息
	Msg    string      `json:"Msg"`             //信息提示
	RunMS  int64       `json:"RunMS"`           //执行时间，单位毫秒 ms
	Data   interface{} `json:"Data,omitempty"`  //结果值
	Err    error       `json:"-"`               //错误
}

// 始初化响应结构体
func NewReply() Reply {
	return Reply{Code: 0, Status: "OK"} //Code: 0 时正确响应了请求，成功
}
